<template>
	<view class="content">
		<!-- <view class="topNav">
			<view class="topNav" style="margin:0 -32rpx ;padding32rpx ;height: 90rpx;">
				<div class="center">考试成绩</div>
			</view>
		</view> -->
		<div style="width: 100%;height: 90rpx;"></div>
		<div class='answerCont'>
			<div class='img'></div>
			<div class='title'>
				你的评分是：{{data.passing_rate}}%
			</div>
			<div>
				<div style='font-size: 32rpx;color: #a67000;margin: 1rem;'>{{data.passing_rate_msg}}</div>
			</div>
			<!-- <div class='info'>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>未做题</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.unanswered_num}}</div>
				</div>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>错题</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.wrong_num}}</div>
				</div>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>错题率</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.error_rate}}%</div>
				</div>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>通过率</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.passing_rate}}%</div>
				</div>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>答题次数</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.total}}</div>
				</div>
				<div>
					<div style='font-size: 30rpx;color: #a67000;'>平均分数</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.avg}}</div>
				</div><div>
					<div style='font-size: 30rpx;color: #a67000;'>答题用时</div>
					<div style='font-size: 36rpx;color: #181E27'>{{data.time||0}}秒</div>
				</div>
				<div></div>
				<div></div>
				<div></div>
				<div></div>
				<div></div>
			</div> -->
			<div class='myBtn' @click='again()'>
				重新练习
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				classroom_practice_id: '',
				exam_no: '',
				data: {}
			}
		},
		onLoad(e) {
			//console.log('e==入参===', e)
			// this.classroom_practice_id = e.classroom_practice_id
			// this.exam_no = e.exam_no
		},
		onShow() {

			// this.getData()
			this.data=uni.getStorageSync("myResults")
			//console.log('执行了onShow')
		},
		mounted() {},
		methods: {
			back() {
				uni.navigateBack()
			},
			getData() {
				let _this = this;
				_this.uniRequest({
					url: `/practice/find_achievement`,
					method: 'post',
					data: {
						classroom_practice_id: _this.classroom_practice_id,
						exam_no: _this.exam_no,
					},
					success: res => {
						//console.log('返回值', res);
						if (res.code == 200) {
							this.data = res.data;
						}
					},
					fail: err => {
						//console.log('request fail错误', err);
					}
				});
			},
			again() {
				// 重新联系返回上一页
				// this.back()
				// uni.redirectTo({
				// 	url: `/pages/course/index`
				// });
				let urlData=uni.getStorageSync("urlData")
				uni.navigateTo({
					url:'/'+urlData
				});
			},
		}
	}
</script>

<style lang='less' scoped>
	.content {
		text-align: center;
min-height: 100vh;
		background-color: #eee7e5;
		.topNav {
			background: #a67000;
			color: white;
			background: #fffaf0;
			color: #000000;
		}

		.img {
			background: url(~@/static/imgs/img_dati_wancheng.png) no-repeat center;
			background-size: 100% 100%;
			width: 354rpx;
			height: 376rpx;
			margin: 100rpx auto 0;
		}

		.title {
			margin: 22rpx auto 0;
			font-size: 36rpx;
			font-weight: bold;
			color: #181E27;
			line-height: 36rpx;
		}

		.info {
			margin: 90rpx auto 0;
			display: flex;
			justify-content: space-around;
			line-height: 60rpx;
			flex-wrap: wrap;

			>div {
				width: 25%;
			}
		}

		.myBtn {
			width: 590rpx;
			line-height: 100rpx;
			/* background: linear-gradient(90deg, #41B2F6 0%, #a67000 100%); */
			border-radius: 12rpx;
			font-size: 30rpx;
			margin: 90rpx auto 0;
			font-family: Hiragino Sans GB;
			font-weight: normal;
			color: #FFFFFF;
			background-color: #a67000;

		}
	}
</style>
